package com.zhenwei.zscm.model.vo.productPart;

import com.zhenwei.zscm.common.annotations.Insert;
import com.zhenwei.zscm.common.annotations.Update;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class ProductPartVO {
    @NotEmpty(message = "主键不能为空", groups = {Update.class})
    private String guid;
    @NotEmpty(message = "产品不能为空", groups = {Insert.class, Update.class})
    private String productCode;
    @NotEmpty(message = "产品不能为空", groups = {Insert.class, Update.class})
    private String productName;
    /**
     * 备件名称
     */
    @NotEmpty(message = "备件名称不能为空", groups = { Insert.class, Update.class })
    private String partName;

    /**
     * 价格
     */
    @NotNull(message = "备件价格不能为空", groups = { Insert.class, Update.class })
    @Min(value = 0, message = "备件价格不能小于0")
    private BigDecimal price;
}
